#include <stdio.h>
#include <unistd.h>

int main()
{
    int cnt = 0;
    while(1)
    {
        pid_t id = fork();
        if(id < 0)
        {
            printf("fork error!, cnt: %d\n",cnt);
        }
        else if(id == 0)
        {
            //child
            while(1)
                sleep(1);
        }
        //partent
        cnt++;

    }
    return 0;
}
